import CPXMTYPE from "@/type/cpxm"
import { isCodeMessage } from "../../config"
import CPXHTYPE from "@/type/cpxh"

/**
 * @author: 小佘佘🦀
 * @description: 添加产品项目
 * @param {CPXMTYPE} cpxm
 * */
export const plusCpxm = async (cpxm: CPXMTYPE) => {


    const response = await fetch(`/api-backend/api/team/cpxmplus`, {
        method: "POST",
        headers: {
            "content-type": "application/json;charset=utf-8",
        },
        body: JSON.stringify(cpxm),
        redirect: "manual"
    })

    return isCodeMessage(response)
}

/**
 * @author: 小佘佘🦀
 * @description: 添加产品型号
 * @param {CPXHTYPE} cpxh
 * */
export const plusCpxh = async (cpxh: CPXHTYPE) => {
    
    const response = await fetch(`/api-backend/api/team/cpxhplus`, {
        method: "POST",
        headers: {
            "content-type": "application/json;charset=utf-8",
        },
        body: JSON.stringify(cpxh),
        redirect: "manual"
    })

    return isCodeMessage(response)
}